package com.burstly.jackson.map.type;

import com.burstly.jackson.type.JavaType;
import java.util.Collection;
import java.util.Map;

public final class SimpleType extends TypeBase
{
  protected final String[] _typeNames;
  protected final JavaType[] _typeParameters;

  protected SimpleType(Class<?> paramClass)
  {
    this(paramClass, null, null, null, null);
  }

  @Deprecated
  protected SimpleType(Class<?> paramClass, String[] paramArrayOfString, JavaType[] paramArrayOfJavaType)
  {
    this(paramClass, paramArrayOfString, paramArrayOfJavaType, null, null);
  }

  protected SimpleType(Class<?> paramClass, String[] paramArrayOfString, JavaType[] paramArrayOfJavaType, Object paramObject1, Object paramObject2)
  {
    super(paramClass, 0, paramObject1, paramObject2);
    if ((paramArrayOfString == null) || (paramArrayOfString.length == 0))
    {
      this._typeNames = null;
      this._typeParameters = null;
      return;
    }
    this._typeNames = paramArrayOfString;
    this._typeParameters = paramArrayOfJavaType;
  }

  public static SimpleType construct(Class<?> paramClass)
  {
    if (Map.class.isAssignableFrom(paramClass))
      throw new IllegalArgumentException("Can not construct SimpleType for a Map (class: " + paramClass.getName() + ")");
    if (Collection.class.isAssignableFrom(paramClass))
      throw new IllegalArgumentException("Can not construct SimpleType for a Collection (class: " + paramClass.getName() + ")");
    if (paramClass.isArray())
      throw new IllegalArgumentException("Can not construct SimpleType for an array (class: " + paramClass.getName() + ")");
    return new SimpleType(paramClass);
  }

  public static SimpleType constructUnsafe(Class<?> paramClass)
  {
    return new SimpleType(paramClass, null, null, null, null);
  }

  protected JavaType _narrow(Class<?> paramClass)
  {
    return new SimpleType(paramClass, this._typeNames, this._typeParameters, this._valueHandler, this._typeHandler);
  }

  protected String buildCanonicalName()
  {
    StringBuilder localStringBuilder = new StringBuilder();
    localStringBuilder.append(this._class.getName());
    int i;
    JavaType[] arrayOfJavaType;
    int k;
    if ((this._typeParameters != null) && (this._typeParameters.length > 0))
    {
      localStringBuilder.append('<');
      i = 1;
      arrayOfJavaType = this._typeParameters;
      int j = arrayOfJavaType.length;
      k = 0;
      if (k >= j)
        localStringBuilder.append('>');
    }
    else
    {
      return localStringBuilder.toString();
    }
    JavaType localJavaType = arrayOfJavaType[k];
    if (i != 0)
      i = 0;
    while (true)
    {
      localStringBuilder.append(localJavaType.toCanonical());
      k++;
      break;
      localStringBuilder.append(',');
    }
  }

  public JavaType containedType(int paramInt)
  {
    if ((paramInt < 0) || (this._typeParameters == null) || (paramInt >= this._typeParameters.length))
      return null;
    return this._typeParameters[paramInt];
  }

  public int containedTypeCount()
  {
    if (this._typeParameters == null)
      return 0;
    return this._typeParameters.length;
  }

  public String containedTypeName(int paramInt)
  {
    if ((paramInt < 0) || (this._typeNames == null) || (paramInt >= this._typeNames.length))
      return null;
    return this._typeNames[paramInt];
  }

  public boolean equals(Object paramObject)
  {
    if (paramObject == this);
    while (true)
    {
      return true;
      if (paramObject == null)
        return false;
      if (paramObject.getClass() != getClass())
        return false;
      SimpleType localSimpleType = (SimpleType)paramObject;
      if (localSimpleType._class != this._class)
        return false;
      JavaType[] arrayOfJavaType1 = this._typeParameters;
      JavaType[] arrayOfJavaType2 = localSimpleType._typeParameters;
      if (arrayOfJavaType1 == null)
      {
        if ((arrayOfJavaType2 != null) && (arrayOfJavaType2.length != 0))
          return false;
      }
      else
      {
        if (arrayOfJavaType2 == null)
          return false;
        if (arrayOfJavaType1.length != arrayOfJavaType2.length)
          return false;
        int i = 0;
        int j = arrayOfJavaType1.length;
        while (i < j)
        {
          if (!arrayOfJavaType1[i].equals(arrayOfJavaType2[i]))
            return false;
          i++;
        }
      }
    }
  }

  public StringBuilder getErasedSignature(StringBuilder paramStringBuilder)
  {
    return _classSignature(this._class, paramStringBuilder, true);
  }

  public StringBuilder getGenericSignature(StringBuilder paramStringBuilder)
  {
    int i = 0;
    _classSignature(this._class, paramStringBuilder, false);
    JavaType[] arrayOfJavaType;
    int j;
    if (this._typeParameters != null)
    {
      paramStringBuilder.append('<');
      arrayOfJavaType = this._typeParameters;
      j = arrayOfJavaType.length;
    }
    while (true)
    {
      if (i >= j)
      {
        paramStringBuilder.append('>');
        paramStringBuilder.append(';');
        return paramStringBuilder;
      }
      paramStringBuilder = arrayOfJavaType[i].getGenericSignature(paramStringBuilder);
      i++;
    }
  }

  public boolean isContainerType()
  {
    return false;
  }

  public JavaType narrowContentsBy(Class<?> paramClass)
  {
    throw new IllegalArgumentException("Internal error: SimpleType.narrowContentsBy() should never be called");
  }

  public String toString()
  {
    StringBuilder localStringBuilder = new StringBuilder(40);
    localStringBuilder.append("[simple type, class ").append(buildCanonicalName()).append(']');
    return localStringBuilder.toString();
  }

  public JavaType widenContentsBy(Class<?> paramClass)
  {
    throw new IllegalArgumentException("Internal error: SimpleType.widenContentsBy() should never be called");
  }

  public JavaType withContentTypeHandler(Object paramObject)
  {
    throw new IllegalArgumentException("Simple types have no content types; can not call withContenTypeHandler()");
  }

  public SimpleType withContentValueHandler(Object paramObject)
  {
    throw new IllegalArgumentException("Simple types have no content types; can not call withContenValueHandler()");
  }

  public SimpleType withTypeHandler(Object paramObject)
  {
    return new SimpleType(this._class, this._typeNames, this._typeParameters, this._valueHandler, paramObject);
  }

  public SimpleType withValueHandler(Object paramObject)
  {
    if (paramObject == this._valueHandler)
      return this;
    return new SimpleType(this._class, this._typeNames, this._typeParameters, paramObject, this._typeHandler);
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.burstly.jackson.map.type.SimpleType
 * JD-Core Version:    0.6.2
 */